package com.dzz.sjgl.jpa;

import com.dzz.sjgl.entity.PaperInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;

/**
 * @author KRIC
 */
public interface PaperRepository extends JpaRepository<PaperInfo, Integer>, JpaSpecificationExecutor<PaperInfo>, Serializable {
    @Modifying
    @Transactional
    @Query(value = "delete from PaperInfo e where e.id in (:ids) ")
    int delPapers(@Param("ids") List<Integer> ids);
}
